﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business.IManager;
using Business.Manager;
using Entity;
using System.Data;

namespace OnlinePayment.Admin
{
    public partial class PostAnnouncement : System.Web.UI.Page
    {
        AnnouncementManager announcementManager = new AnnouncementManager();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(Session["Administrator"]==null){
            }
        }
        protected void btnCancle_Click(object sender, EventArgs e)
        {

        }

        protected void btn_addarticle_Click(object sender, EventArgs e)
        {
            Announcement announcement = new Announcement();
            announcement.Athour = this.txtAuthor.Text;
            announcement.Title = this.txtTitle.Text;
            announcement.Content = this.article_context.Text;
            if (announcementManager.generateAnnouncement(announcement))
            {
                Response.Write("<script language=javascript>alert('文章添加成功!');location='AnnoucementList.aspx'</script>");
            }
            else
            {
                Response.Write("<script language=javascript>alert('文章添加失败！');location='javascript:history.go(-1)'</script>");
            }
        }

        protected void btn_back_Click(object sender, EventArgs e)
        {

        }

    }
}